<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<head>

    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>


    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/font-awesome.css}" rel="stylesheet"/>
    <link th:href="@{/css/animate.css}" rel="stylesheet"/>
    <link th:href="@{/css/style.css}" rel="stylesheet"/>

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-6">
            <div class="ibox-content" style="width: 700px;height: 400px">
                <form class="form-horizontal m-t" id="commentForm" >
                    <div class="form-group">
                        <label class="col-sm-3 control-label">用户ID：</label>
                        <div class="col-sm-8">
                            <label class="form-control" id="userId" th:text="${userId}"></label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">用户名称：</label>
                        <div class="col-sm-8">
                            <input id="name" type="text" class="form-control" name="url"
                                   th:value="${userName}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">新密码：</label>
                        <div class="col-sm-8">
                            <input id="password" type="text" class="form-control" name="url"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-3">
                            <input type="button" class="btn btn-primary" onclick="upload()" value="提交"></input>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


<!-- 全局js -->
<script th:src="@{/js/jquery.min.js?v=2.1.4}"></script>
<script th:src="@{/js/bootstrap.min.js?v=3.3.6}"></script>

<!-- 自定义js -->
<script th:src="@{/js/content.js?v=1.0.0}"></script>

<!-- jQuery Validation plugin javascript-->
<script th:src="@{/js/plugins/validate/jquery.validate.min.js}"></script>
<script th:src="@{/js/plugins/validate/messages_zh.min.js}"></script>

<script th:src="@{/js/demo/form-validate-demo.js}"></script>
<!-- Input Mask-->
<script th:src="@{/js/plugins/jasny/jasny-bootstrap.min.js}"></script>

<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<!--统计代码，可删除-->
<script th:inline="javascript">
    function upload() {


        // updateuser.push($("#userId").text());
        // updateuser.push($("#name").val());
        // updateuser.push($("#password").val());
            var password=$("#password").val();
            if(password==""){
                layer.msg('密码不能为空', function(){
                    return;
                });
                return;
            }

        $.ajax({
            url:"userUpdate.shtml",
            type:"post",
            data:{
                "userId":$("#userId").text(),
                "userName":$("#name").val(),
                "userPass":password
            },
            success:function (data) {
                layer.closeAll();
                layer.msg("修改成功");
                location.reload();
            }
        })
    }
</script>
</body>

</html>
